﻿// Copyright (c)  MOKEYISH. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System.Collections.Generic;

namespace NSQL.LogicalResource
{
    public class LogicalSchema : ILogicalSchema
    {
        private readonly List<ILogicalTable> _tables = new List<ILogicalTable>();
        public ILogicalDatabase Database { get; set; }
        public string Name { get; set; }
        public IReadOnlyList<ILogicalTable> Tables => _tables;
        public void Add(ILogicalTable table) => _tables.Add(table);

        public void Add(LogicalTable table)
        {
            table.Schema = this;
            _tables.Add(table);
        }
    }
}